Skip to content

Avoid triggering uninitialized warning in RVec#22468

Merged
vepadulano merged 2 commits into
root-project:masterfrom
vepadulano:rdf-gcc16-uninitialized-warning
Jun 5, 2026
Merged

Avoid triggering uninitialized warning in RVec#22468
vepadulano merged 2 commits into
root-project:masterfrom
vepadulano:rdf-gcc16-uninitialized-warning

Conversation

@vepadulano

Copy link
Copy Markdown
Member

Fixes #22467

For now the PR only contains the commit adding the test, to make sure we can see the failure in the CI as well.

@vepadulano vepadulano self-assigned this Jun 3, 2026
@vepadulano vepadulano added in:Math Libraries clean build Ask CI to do non-incremental build on PR labels Jun 3, 2026
@vepadulano vepadulano closed this Jun 3, 2026
@vepadulano vepadulano reopened this Jun 3, 2026
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

Test Results

    22 files      22 suites   3d 14h 15m 24s ⏱️
 3 863 tests  3 863 ✅ 0 💤 0 ❌
76 238 runs  76 238 ✅ 0 💤 0 ❌

Results for commit b441aeb.

♻️ This comment has been updated with latest results.

@vepadulano

Copy link
Copy Markdown
Member Author

Failing test visible at https://github.com/root-project/root/actions/runs/26879891828/job/79276912873?pr=22468#step:8:14757

 -- TEST COMMAND -- 
  cd /github/home/ROOT-CI/build/roottest/root/aclic/rvec_uninitialized
  /usr/sbin/timeout -s USR2 270s /github/home/ROOT-CI/build/bin/root.exe -e '#define CLING_WITH_ADAPTIVECPP' -e '#define ClingWorkAroundMissingDynamicScope' -e '#define ClingWorkAroundUnnamedInclude' -e '#define ClingWorkAroundMissingSmartInclude' -e '#define ClingWorkAroundNoDotInclude' -e '#define ClingWorkAroundMissingAutoLoadingForTemplates' -e '#define ClingWorkAroundTClassUpdateDouble32' -e '#define ClingWorkAroundAutoParseDeclaration' -e '#define ClingWorkAroundMissingUnloading' -e '#define ClingWorkAroundBrokenUnnamedReturn' -e '#define ClingWorkAroundUnnamedDetection2' -e '#define ClingWorkAroundNoPrivateClassIO' -e '#define ClingWorkAroundUnloadingVTABLES' -e 'gSystem->SetBuildDir("/github/home/ROOT-CI/build/roottest/root/aclic/rvec_uninitialized",true)' -e 'gSystem->AddDynamicPath("/github/home/ROOT-CI/build/roottest/root/aclic/rvec_uninitialized")' -e 'gROOT->SetMacroPath("/github/home/ROOT-CI/src/roottest/root/aclic/rvec_uninitialized")' -e 'gInterpreter->AddIncludePath("-I/github/home/ROOT-CI/build/roottest/root/aclic/rvec_uninitialized")' -e 'gSystem->AddIncludePath("-I/github/home/ROOT-CI/build/roottest/root/aclic/rvec_uninitialized")' -q -b /github/home/ROOT-CI/src/roottest/root/aclic/rvec_uninitialized/rvec_uninitialized.C+
  -- BEGIN TEST OUTPUT --
  Processing /github/home/ROOT-CI/src/roottest/root/aclic/rvec_uninitialized/rvec_uninitialized.C+...
  Info in <TUnixSystem::ACLiC>: creating shared library /github/home/ROOT-CI/build/roottest/root/aclic/rvec_uninitialized/rvec_uninitialized_C.so
  In file included from /github/home/ROOT-CI/src/roottest/root/aclic/rvec_uninitialized/rvec_uninitialized.C:1,
                   from /github/home/ROOT-CI/build/roottest/root/aclic/rvec_uninitialized/rvec_uninitialized_C_ACLiC_dict.cxx:41:
  /github/home/ROOT-CI/build/include/ROOT/RVec.hxx: In constructor ‘ROOT::Internal::VecOps::SmallVectorTemplateCommon<T>::SmallVectorTemplateCommon(size_t) [with T = bool]’:
  /github/home/ROOT-CI/build/include/ROOT/RVec.hxx:222:68: warning: ‘<unknown>’ may be used uninitialized [-Wmaybe-uninitialized]
    222 |    SmallVectorTemplateCommon(size_t Size) : Base(getFirstEl(), Size) {}
        |                                                                    ^
  /github/home/ROOT-CI/build/include/ROOT/RVec.hxx:214:10: note: by argument 1 of type ‘const ROOT::Internal::VecOps::SmallVectorTemplateCommon<bool>*’ to ‘void* ROOT::Internal::VecOps::SmallVectorTemplateCommon<T>::getFirstEl() const [with T = bool]’ declared here
    214 |    void *getFirstEl() const
        |          ^~~~~~~~~~
  In file included from /github/home/ROOT-CI/src/roottest/root/aclic/rvec_uninitialized/rvec_uninitialized.C:1,
                   from /github/home/ROOT-CI/build/roottest/root/aclic/rvec_uninitialized/rvec_uninitialized_C_ACLiC_dict.cxx:41:
  /github/home/ROOT-CI/build/include/ROOT/RVec.hxx: In constructor ‘ROOT::Internal::VecOps::SmallVectorTemplateCommon<T>::SmallVectorTemplateCommon(size_t) [with T = bool]’:
  /github/home/ROOT-CI/build/include/ROOT/RVec.hxx:222:68: warning: ‘<unknown>’ may be used uninitialized [-Wmaybe-uninitialized]
    222 |    SmallVectorTemplateCommon(size_t Size) : Base(getFirstEl(), Size) {}
        |                                                                    ^
  /github/home/ROOT-CI/build/include/ROOT/RVec.hxx:214:10: note: by argument 1 of type ‘const ROOT::Internal::VecOps::SmallVectorTemplateCommon<bool>*’ to ‘void* ROOT::Internal::VecOps::SmallVectorTemplateCommon<T>::getFirstEl() const [with T = bool]’ declared here
    214 |    void *getFirstEl() const
        |          ^~~~~~~~~~
  
  -- END TEST OUTPUT --
  -- BEGIN OUTDIFF OUTPUT --
  --- /github/home/ROOT-CI/src/roottest/root/aclic/rvec_uninitialized/rvec_uninitialized.ref	Wed Jun  3 10:49:51 2026
  +++ /github/home/ROOT-CI/build/roottest/root/aclic/rvec_uninitialized/rvec_uninitialized.log	Wed Jun  3 11:55:33 2026
  @@ -0,0 +1,18 @@
  +In file included from /github/home/ROOT-CI/src/roottest/root/aclic/rvec_uninitialized/rvec_uninitialized.C:1,
  +                 from /github/home/ROOT-CI/build/roottest/root/aclic/rvec_uninitialized/rvec_uninitialized_C_ACLiC_dict.cxx:41:
  +/github/home/ROOT-CI/build/include/ROOT/RVec.hxx: In constructor ‘ROOT::Internal::VecOps::SmallVectorTemplateCommon<T>::SmallVectorTemplateCommon(size_t) [with T = bool]’:
  +/github/home/ROOT-CI/build/include/ROOT/RVec.hxx:222:68: warning: ‘<unknown>’ may be used uninitialized [-Wmaybe-uninitialized]
  +  222 |    SmallVectorTemplateCommon(size_t Size) : Base(getFirstEl(), Size) {}
  +      |                                                                    ^
  +/github/home/ROOT-CI/build/include/ROOT/RVec.hxx:214:10: note: by argument 1 of type ‘const ROOT::Internal::VecOps::SmallVectorTemplateCommon<bool>*’ to ‘void* ROOT::Internal::VecOps::SmallVectorTemplateCommon<T>::getFirstEl() const [with T = bool]’ declared here
  +  214 |    void *getFirstEl() const
  +      |          ^~~~~~~~~~
  +In file included from /github/home/ROOT-CI/src/roottest/root/aclic/rvec_uninitialized/rvec_uninitialized.C:1,
  +                 from /github/home/ROOT-CI/build/roottest/root/aclic/rvec_uninitialized/rvec_uninitialized_C_ACLiC_dict.cxx:41:
  +/github/home/ROOT-CI/build/include/ROOT/RVec.hxx: In constructor ‘ROOT::Internal::VecOps::SmallVectorTemplateCommon<T>::SmallVectorTemplateCommon(size_t) [with T = bool]’:
  +/github/home/ROOT-CI/build/include/ROOT/RVec.hxx:222:68: warning: ‘<unknown>’ may be used uninitialized [-Wmaybe-uninitialized]
  +  222 |    SmallVectorTemplateCommon(size_t Size) : Base(getFirstEl(), Size) {}
  +      |                                                                    ^
  +/github/home/ROOT-CI/build/include/ROOT/RVec.hxx:214:10: note: by argument 1 of type ‘const ROOT::Internal::VecOps::SmallVectorTemplateCommon<bool>*’ to ‘void* ROOT::Internal::VecOps::SmallVectorTemplateCommon<T>::getFirstEl() const [with T = bool]’ declared here
  +  214 |    void *getFirstEl() const
  +      |          ^~~~~~~~~~
  
  -- END OUTDIFF OUTPUT --

@vepadulano vepadulano force-pushed the rdf-gcc16-uninitialized-warning branch from fa99249 to b441aeb Compare June 3, 2026 14:10
@vepadulano vepadulano marked this pull request as ready for review June 3, 2026 14:11

@guitargeek guitargeek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@hahnjo

hahnjo commented Jun 4, 2026

Copy link
Copy Markdown
Member

I don't see LLVM upstream doing anything similar, but can't see a difference in our code. What is triggering this for us?

@vepadulano

vepadulano commented Jun 4, 2026

Copy link
Copy Markdown
Member Author

I don't see LLVM upstream doing anything similar, but can't see a difference in our code. What is triggering this for us?

Happens if a struct with RVec<bool> is involved in the generation and subsequent usage of a ROOT dictionary, with GCC16.

@vepadulano

Copy link
Copy Markdown
Member Author

The issue is much more widespread, as demonstrated by https://github.com/root-project/root/actions/runs/26955003387/job/79529828759?pr=22480#step:8:4508

The missing part to make it that much visible was compiling ROOT with CMAKE_BUILD_TYPE=Debug, then the warnings appear pretty much everywhere that uses RVec

@vepadulano vepadulano merged commit 9fe1406 into root-project:master Jun 5, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clean build Ask CI to do non-incremental build on PR in:Math Libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ACLiC on Fedora 44 and GCC 16 in debug mode triggers uninitialized warning in RVec

3 participants